<template>
  <Participant :value="participant"
               tagClass="to"
               tagName="收" />
</template>

<script>
import OrderMixin from "@/components/order/order.mixin";
import Participant from "@/components/basic/Participant.vue";
export default {
  name: "OrderConsignee",
  mixins: [OrderMixin],
  components: { Participant },
  props: ["value"],
  computed: {
    participant () {
      const { consigneeName } = this.consignee;
      const { contactName, contactMobile, city, province, district, address } = this.toAddress;
      const additionals = [];
      if (this.toTime) {
        additionals.push("收货时间: " + this.$moment(this.toTime).format("YYYY-MM-DD HH:mm"));
      }

      return {
        contactName,
        contactMobile,
        name: consigneeName,
        city,
        province,
        district,
        address,
        additionals
      };
    }
  }
};
</script>
